# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-lub
_rockname=lub
pkgver=1.1.0
pkgrel=3
pkgdesc="Lubyk base module for Lua"
url="http://doc.lubyk.org/lub.html"
arch="noarch"
license="MIT"
depends="lua lua-filesystem"
source="$pkgname-$pkgver.tar.gz::https://github.com/lubyk/$_rockname/archive/REL-$pkgver.tar.gz"
builddir="$srcdir/$_rockname-REL-$pkgver"
options="!check"

for _v in 5.1 5.2 5.3 5.4; do
	provides="$provides lua$_v-$_rockname=$pkgver-r$pkgrel"
done

package() {
	local rockdir="$pkgdir/usr/lib/luarocks/rocks-common/$_rockname/$pkgver-2"

	mkdir -p "$pkgdir"/usr/share/lua/common
	cp -r "$builddir"/lub "$pkgdir"/usr/share/lua/common/

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}

sha512sums="46f18cfc12d919694ddba7ab875e579381cd964c18b91dfb46d4f8091b90fd7daef96eaf0e16bd4fb3e01962adb74eeed47259aac014ebf24f85955d99a873f3  lua-lub-1.1.0.tar.gz"
